package jhunter.dao;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class EntityContainer {

	private Log log = LogFactory.getLog(this.getClass());
	
	private Map<String, EntityExt> container = new HashMap<String, EntityExt>();

	public synchronized void registEntityExt(EntityExt entity) {
		log.debug("load entity : " + entity.getEntity().getId());
		container.put(entity.getEntity().getId(), entity);
	}

	public synchronized void remove(String entityId) {
		container.remove(entityId);
	}

	public EntityExt getEntityExt(String id) {
		return container.get(id);
	}

	public Map<String, EntityExt> getContainer() {
		return container;
	}

}
